﻿#ifndef BUSINESSCHAT_H
#define BUSINESSCHAT_H

#include <QJsonObject>

class BusinessChat
{
public:
    // 删除拷贝构造函数和拷贝赋值操作符
    BusinessChat(BusinessChat const&) = delete;
    BusinessChat& operator=(BusinessChat const&) = delete;
    // 提供一个全局唯一的接口
    static BusinessChat& getInstance() {
        static BusinessChat instance;
        return instance;
    }

    // chat to someone
    void chatEvent(QJsonObject& in, QJsonObject& out);

    // chat to some one
    void chatToFriend(QJsonObject& in, QJsonObject& out);

    // chat to a group
    void chatToGroup(QJsonObject& in, QJsonObject& out);
    // 发送一个图片
    void sendPicture(QJsonObject &in, QJsonObject &out);

    // request if exist message when offine
    void requestOfflineMessage(QJsonObject& in, QJsonObject & out);

    // 检查目标文件路径是否存在，如果不存在，则向服务器请求
    void getPicture(QJsonObject& in, QJsonObject& out);


    BusinessChat();
};

#endif // BUSINESSCHAT_H
